package com.stone.customview;

/**
 * @author Stone
 * @version V1.0
 * @description:
 * @date 10/24/18 19:13
 * @email redsstone@163.com
 */
public class SumTest {

    public static void main(String[] args) {
        SumTest test = new SumTest();
        test.sum(8);
    }

    private int sum;
    private int currentNum;
    public void sum(int count){

        for (int i = 0; i < count; i++) {
            currentNum = count * (int)Math.pow(10, i) + currentNum;
            System.out.println("每次的值：" + currentNum);
            sum += currentNum;
        }
        System.out.println(">>>>>>>>>>>");
        System.out.println("总和"+ sum);
    }
}
